﻿using System.Collections.Generic;

namespace MicroCloud.Tests.Tree
{
    public class TreeNode
    {
        public TreeNode(int id, int? pId)
        {
            this.Id = id;
            this.ParentId = pId;
        }

        public int Id { get; set; }

        public int? ParentId { get; set; }

        public bool HasChildren => Children.Count > 0;

        public TreeNode Parent { get; set; } = null;

        public List<TreeNode> Children { get; set; } = new();
    }
}
